<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>

<link rel="stylesheet" type="text/css" media="screen"
	href="${ctx}/static/jqgrid/css/ui.jqgrid.css" />
<link rel="stylesheet" type="text/css" media="screen"
	href="${ctx}/static/css/flick/jquery-ui-1.8.22.custom.css" />
<script src="${ctx}/static/js/jquery.min.js"
	type="text/javascript"></script>

<script src="${ctx}/static/jqgrid/js/i18n/grid.locale-cn.js"
	type="text/javascript"></script>
<script src="${ctx}/static/jqgrid/js/jquery.jqGrid.min.js"
	type="text/javascript"></script>




	
<script type="text/javascript">
	jQuery(document).ready(function() {
		jQuery("#list").jqGrid({
			url : '${ctx}/order/product/proList2/1',
		//	url : 'data.json',
			datatype : 'json',
			mtype : 'GET',
			colNames : [ '', '产品名称', '产品剩余量' ],
			colModel : [ {
				name : 'id',
				index : 'id',
				align : 'center',
				editable : true,
				editoptions:{readonly:true} 
			}, {
				name : 'proName',
				index : 'proName',
				align : 'center',
				editable : true
			}, {
				name : 'proRest',
				index : 'proRest',
				align : 'center',
				editable : true
			} ],
			jsonReader: {
				repeatitems : false
			},
			pager : '#pager',
			rowNum : 4,
			rowList : [ 1, 2, 3 ],
			sortname : 'id',
			sortorder : 'desc',
			viewrecords : true,
			reloadAfterSubmit:true,
			width:900,
			
			
			editurl:'${ctx}/order/product/edit/',
		//	addurl:'${ctx}/order/product/update/',
		//	delurl:'${ctx}/order/product/delete/'
			caption : '产品列表'
		});
		
		jQuery("#list").jqGrid('navGrid', '#pager',{
			add:true,
			edit:true,
			del:true
		},{
			closeAfterEdit:true,			//edit
			reloadAfterSubmit : true,
			checkOnSubmit:true
		},{									//add
			closeAfterAdd:true,
			reloadAfterSubmit : true,
		},{									//del
		
		},{								    //search
			closeAfterSearch:true,
			reloadAfterSubmit : true,
			multipleSearch:true
		});
	});
</script>
</head>
<body>
	<div style="margin-left:100px;">
		<table id="list"></table>
		<div id="pager"></div>
	</div>
	
</body>
</html>